Module-level declarations

Queries

Link copied to clipboard
@mount("ft4.get_account_id_for_strategy") query get_account_id_for_strategy(strategy_operation: gtx_operation): byte_array

Retrieves the id of the account that will the result of registering an account using the provided strategy operation.

Usually called before the account is registered, but it will give the same result after the account was registered as well.

Link copied to clipboard
@mount("ft4.get_enabled_registration_strategies") query get_enabled_registration_strategies(): set<text>

Fetches an array of registrations strategies that are currently enabled on this chain.

Link copied to clipboard
@mount("ft4.get_register_account_message") query get_register_account_message(strategy_operation: gtx_operation, register_account_operation: gtx_operation): text

Fetches the message that the user must sign in order to register an account, provided that they are using evm signatures.

Throws if the strategy cannot be found. If strategy_name is correct, this could also be caused by having misconfigured the registration defined in the function that extends strategy in such a way that the strategy name and the _strategy.op.mount_name are not the same value.

Operations

Link copied to clipboard
@mount("ft4.register_account") operation register_account()

An operation which can be called to create an account. This operation is part of the account registration framework and it must be preceded by a strategy operation which contains information about how the account is supposed to be registered.

Throws if the operation that came just before this one cannot be handled. Common cases are:

  • the operation is not registered as a strategy operation through extensions of strategy

  • the operation has been misconfigured, and its name does not match the operation mount name

Throws if the signature verification is unsuccessful. Common cases are:

  • evm_signatures is misconfigured:

    • any of the signers and signatures don't match in the exact order they're found

    • any of the signatures is null

    • there's more signatures than signers

  • a signature from one of the auth descriptor participants is missing:

    • an EVM signer is specified but the signature is not found in evm_signatures

    • an FT signer is specified but the signature is not in the transaction

    • a signer passed is neither an EVM nor an FT signer (its length does not match either of core.auth.EVM_ADDRESS_SIZE and core.auth.FT_PUBKEY_SIZE)

Throws if either auth descriptor is invalid. Common cases include:

  • the main auth descriptor has expiration rules instead of core.accounts.GTV_NULL

  • the disposable auth descriptor's expiration rules:

    • is a complex rule with too many rule components

    • has already expired

    • is not the valid GTV representation of a rule

  • errors with the args field:

    • some required flags are missing

    • in multi-sig auth descriptors, the required_signatures field:

      • is 0 or less

      • is greater than the number of signers

Throws if core.accounts.AUTH_DESCRIPTORS_PER_ACCOUNT_UPPER_BOUND is set to 1 and disposable passed to the strategy operation is not null.

Throws if some conditions added in development through extensions (before_register_account or after_register_account) aren't met